package cn.jiyun.controller;

import cn.jiyun.pojo.User;
import cn.jiyun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author Fay
 * @date 2022/6/27&23:19
 */
@RestController
public class ProviderController {
    @Autowired
    private UserService userService;

    @RequestMapping("/getUserById")
    public User getUserById(Integer id){
        try {
            Thread.sleep(500);
            System.out.println(Thread.currentThread().getName()+"------"+new Date());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return userService.getUserById(id);
    }
}
